Computing platforms may include heterogeneous processors such as central processing units (CPUs) and non-CPUs (for example, a graphics processing unit (GPU)). Both the CPUs and non-CPUs access memory pages to perform functions such as write and read. At present, pages shared between CPU and GPU should be statically allocated in advance, and these physical memory pages should be pinned to prevent Page Fault on GPU as long as the GPU is using them.
Thus, the memory pages committed (or pinned) to the non-CPU are statically “pinned”. The OS may remove such pinned memory pages from the pool of memory pages to avoid the other CPUs or non-CPUs from accessing the pinned pages. Such an approach may lead to non-optimal performance of the computer platform. Some of the challenges associated with such an approach are (1) all the memory pages required to be pinned to the non-CPU have to be identified in advance; and (2) the OS may remove the pinned pages from the pool of memory pages to avoid the pinned memory pages from being allocated to other CPUs or non-CPUs while the accessing no-CPU is still active. To determine, in advance, the memory pages, which have to be pinned is a non-deterministic and tedious process. For example, if GPU should access some small part of very large texture, CPU should still lock the whole texture. Also, removing the pinned memory pages from the pool of memory pages may reduce the memory pages available for the other CPUs and non-CPUs, thus the performance of the computing system may be reduced.